package com.elong.android.specialhouse.adapter.common;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;


/**
 * 
 * @interfaceName: PowerAdapter
 * @Description: 大部分的adapter都通过直接new一个该类对象并实现convert(holder, item)方法即可
 * @author kaiqi.li
 * @date 2015-7-28 下午4:2:37
 */
public abstract class PowerAdapter<T> extends BasePowerAdapter<T, BaseViewHolder> {
	
	public PowerAdapter(Context context , int layoutId){
		super(context, layoutId);
	}
	
	public PowerAdapter(Context context , int layoutId , List<T> datas){
		super(context, layoutId, datas);
	}
	
	public PowerAdapter(Context context , List<T> datas,MultiItemType<T> multiItemType){
		super(context, datas,multiItemType);
	}
	
	@Override
	public BaseViewHolder getAdapterHolder(int position, View convertView,
			ViewGroup parent) {
		
		if (mMultiItemType != null) {
			return BaseViewHolder.get(mContext, convertView, parent, mMultiItemType.getLayoutId(position, mDatas.get(position)), position);
		}
		
		return BaseViewHolder.get(mContext, convertView, parent, mItemLayoutId, position);
	}
}
